<?php

        // lib
        Include "app/persistance/requete.php";


if(isset($_POST['link']))
{
    $link=$_POST['link'];
    $preg_match = preg_match("/v=.........../", $link, $matches);
    $link = substr($matches[0], 2);
}
else
    $link="";

//echo  "link = {$link}"; //debug

if(isset($_POST['location']))
    $location=$_POST['location'];
else
    $location="";

//echo "location = {$location}"; // debug

if(empty($link))
{
    echo "Saisie incorrecte.";
}
else
{
    addVideoInDB($link,$location);
}


?>
